package main

import "fmt"

func sum(n1 int, n2 int) int {

	// 当执行到defer时，暂时不执行，会将defer后面的语句压入到独立的栈中
	defer fmt.Println("ok1 n1 =", n1)
	defer fmt.Println("ok2 n2 =", n2)
	res := n1 + n2
	fmt.Println("ok3 res =", res)
	return res
}

func main() {
	sum(10, 20)
}